package com.ldzy.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ldzy.dao.HousingMapper;
import com.ldzy.dao.UserMapper;
import com.ldzy.pojo.Housing;
import com.ldzy.pojo.User;
import com.ldzy.service.IHousingService;
import com.ldzy.service.IUserService;
import com.ldzy.utilts.RespUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;


/**
 *
 */
@Service
public class HousingServiceImpl extends ServiceImpl<HousingMapper,Housing> implements IHousingService {
@Resource HousingMapper housingMapper;

    @Override
    public Housing getByIdHousing(Housing housing) {
        return housingMapper.getByIdHousing(housing);
    }

    @Override
    public RespUtil updateByHouseNumberWater(Housing housing) {
        if (housingMapper.updateByHouseNumberWater(housing)<0)
            return RespUtil.error("交费失败!");
        return  RespUtil.success("交费成功");
    }

    @Override
    public RespUtil updateByHouseNumberPower(Housing housing) {
        if (housingMapper.updateByHouseNumberPower(housing)<0)
            return RespUtil.error("交费失败!");
        return  RespUtil.success("交费成功");
    }

    @Override
    public RespUtil updateByHouseRevise(Housing housing) {
        if (housingMapper.updateByHouseRevise(housing)<0)
            return RespUtil.error("房屋过户失败!");
        return  RespUtil.success("房屋过户成功");
    }


    @Override
    public List<Housing> getAllHousing() {
        return housingMapper.getAllHousing();
    }

    @Override
    public Housing getByHouseNumberHousing(Housing housing) {
        return housingMapper.getByHouseNumberHousing(housing);
    }
}
